<?php
/* @var $this LabController */
/* @var $model Lab */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'lab-form',
	'enableAjaxValidation'=>false,
                    'htmlOptions'=>array('enctype'=>'multipart/form-data'),
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'labtype_id'); ?>
		<?php echo $form->dropDownList($model,'labtype_id', $model->getLabTypeOptions());?>
		<?php echo $form->error($model,'labtype_id'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'lab_name'); ?>
		<?php echo $form->textField($model,'lab_name',array('size'=>60,'maxlength'=>100)); ?>
		<?php echo $form->error($model,'lab_name'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'description'); ?>
		<?php echo $form->textArea($model,'description',array('rows'=>6, 'cols'=>50)); ?>
	  	<script type="text/javascript">
			var editor = new UE.ui.Editor();
			editor.render("Lab_description");
		</script>
	    <?php echo $form->error($model,'description'); ?>
	</div>
                    
                    <div class="row">
                        <?php echo $form->labelEx($model, 'image'); ?>
                        <?php echo $form->textField($model,'image',array('size'=>60,'maxlength'=>200));?>
                        <input type="file" id="newsImageView" name="imageFile" style="width:100%;" accept="image/*" onchange="return newsImagePreview()"/>
                        <img src="<?php echo yii::app()->baseUrl.'/'.$model->picture->description.$model->picture->fileName;?>" id="imageViewer" style="width:250px; height:200px;"></img>
                        <?php echo $form->error($model,'image'); ?>
                    </div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->
